<?php
require("../config.php");
require_once($CONF['root.dir']."database.php");
$id_pelamar     = $_POST["id_pelamar"];
$nama 		 	= $_POST["nama"];
$id_panitia 	= $_POST["id_panitia"];
$jabatan 		= $_POST["jabatan"];
$DATA 		 	= $_POST["DATA"];
$ACTION 		= $_POST["ACTION"];

if(strtoupper($ACTION)=="SAVE"){
	$SQL="INSERT INTO tblpanitia 
			(id_panitia, 
			id_pelamar, 
			nama, 
			jabatan
			)
			VALUES
			('".$id_panitia."', 
			'".$id_pelamar."', 
			'".$nama."', 
			'".$jabatan."'
			)";
	$conn->connect();
	$exec=$conn->execute($SQL);
	$conn->connect();
	if($exec){echo "1|Data berhasil diproses.".$SQL;}else{echo "0|Data gagal diproses.";}
}else if(strtoupper($ACTION)=="UPDATE"){
	$conn->connect();
	$SQL = "UPDATE tblpanitia 
			SET
			id_panitia = '".$id_panitia."' , 
			id_pelamar = '".$id_pelamar."' , 
			nama = '".$nama."' , 
			jabatan = '".$jabatan."'
			WHERE
			id_panitia = '".$DATA."' ;
		";
	$exec=$conn->execute($SQL);
	$conn->disconnect();
	if($exec){echo "1|Data berhasil diproses.";}else{echo "0|Data gagal diproses.".$SQL;}
}

?>